package com.lemeng.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.lemeng.entity.Result;
import com.lemeng.pojo.User;
import com.lemeng.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {

    @Reference
    UserService userService;

    @RequestMapping("sendSms")
    public Result sendSms(@RequestParam String phone){
        userService.sendSms(phone);
        return new Result();
    }

    @RequestMapping("register")
    public Result register(@RequestParam String code, @RequestBody User user){
        userService.register(code,user);
        return new Result();
    }
}
